﻿/****************************************************************
*   作者：Schme
*   CLR版本：4.0.30319.42000
*   创建时间：2017/4/6 9:10:45
*   2017
*   描述说明：会员信息
*
*   修改历史：
*
*
*****************************************************************/
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations;

namespace Mt.Site.Core.Members
{
    public class Member : FullAuditedEntity<Guid>, IPassivable
    {
        public const int MaxLoginNameLength = 20;
        public const int MaxPasswordLength = 50;
        public const int MaxEmailLength = 50;
        public const int MaxIPLength = 50;
        public const int MaxRegisterFormLength = 20;

        /// <summary>
        /// 登陆账号
        /// </summary>
        [StringLength(MaxLoginNameLength)]
        public virtual string LoginName { get; set; }
        
        /// <summary>
        /// 密码
        /// </summary>
        [StringLength(MaxPasswordLength)]
        public virtual string Password { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(MaxEmailLength)]
        public virtual string Email { get; set; }

        /// <summary>
        /// trainning许可
        /// </summary>
        public bool IsTrainingAllowed { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 注册来源
        /// </summary>
        [StringLength(MaxRegisterFormLength)]
        public virtual string RegisterForm { get; set; }

        /// <summary>
        /// 是否接收信息
        /// </summary>
        public virtual bool? IsReceive { get; set; }

        /// <summary>
        /// 注册IP
        /// </summary>
        [StringLength(MaxIPLength)]
        public virtual string IP { get; set; }

        /// <summary>
        /// 登陆次数
        /// </summary>
        [Range(0, int.MaxValue)]
        public virtual int LoginCount { get; set; }

        /// <summary>
        /// 失败次数
        /// </summary>
        [Range(0, int.MaxValue)]
        public virtual int FailLoginCount { get; set; }

        //锁定结束时间
        public DateTime? FreezeEndTime { get; set;}

        /// <summary>
        /// 上次登陆时间
        /// </summary>
        public virtual DateTime? LastLoginTime { get; set; }


        /// <summary>
        /// 校验
        /// </summary>
        [StringLength(100)]
        public string VerificationCode { get; set; }
    }
}
